package design;

abstract class AbstractClass{
    protected void step1(){
        System.out.println("AbstractClass:step1");
    }

    protected void step2(){
        System.out.println("AbstractClass:step2");
    }

    protected void step3(){
        System.out.println("AbstractClass:step3");
    }

    public final void templateMethod(){
        this.step1();
        this.step2();
        this.step3();
    }
}

class ConcreteClassA extends AbstractClass{
    @Override
    protected void step1() {
        System.out.println("ConcreteClassA:step1");
    }
}

public class Client {
    public static void main(String[] args) {
        AbstractClass abc = new ConcreteClassA();
        abc.templateMethod();
    }
}
